# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：     DriverObj.py
   Description :
   Author :        ZhangYiLin
   date：          2020/12/09 09:55
-------------------------------------------------
   Change Activity:
                   2020/12/09 09:55
-------------------------------------------------
"""
import pytest
from selenium import webdriver
from common.NewLoguru import global_log

_driver = None


@pytest.fixture(scope='module')
def driver():
    """
    打开和关闭浏览器
    """
    global _driver
    global_log.info(
        '------------------------------------open browser------------------------------------')
    _driver = webdriver.Chrome()
    _driver.maximize_window()
    yield _driver
    global_log.info(
        '-----------------------------------close browser-----------------------------------')
    _driver.quit()
